package com.csii.modules.system.service;

import com.csii.core.constant.CacheConstant;
import com.csii.core.system.vo.ComboModel;
import com.csii.core.system.vo.DictModel;
import com.csii.core.system.vo.DynamicDataSourceModel;
import com.csii.core.system.vo.SysCategoryModel;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @Description TODO
 * @Date 2020/9/2 7:33
 * @Created by Ian
 * @Contact: 19107614@qq.com
 */
public interface ISysBaseAPI {
    void addLog(String LogContent, Integer logType, Integer operatetype);

    String getDatabaseType() throws SQLException;

    @Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "T(com.csii.core.util.TenantContext).getTenantDefaultString()+#code")
    List<DictModel> queryDictItemsByCode(String code);

    List<DictModel> queryTableDictItemsByCode(String table, String text, String code);

    List<DictModel> queryAllDepartBackDictModel();

    void updateSysAnnounReadFlag(String busType, String busId);

    String parseTemplateByCode(String templateCode, Map<String, String> map);

    List<DictModel> queryAllDict();

    List<SysCategoryModel> queryAllDSysCategory();

    List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql);

    List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray);

    List<ComboModel> queryAllUser();

    DynamicDataSourceModel getDynamicDbSourceById(String dbSourceId);

    DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode);

    void sendWebSocketMsg(String[] userIds, String cmd);

    void meetingSignWebsocket(String userId);

    /**
     * 发送工作流系统消息
     * @param actBusId 流程业务id
     * @param fromUser 发送人(用户登录账户)
     * @param fromUser 发送人(用户登录账户)
     * @param toUser  发送给(用户登录账户)
     * @param title  消息主题
     * @param msgContent  消息内容
     */
     void sendSysAnnouncementAct(String actBusId, String fromUser,String toUser,String title, String msgContent);

    /**
     * 系统内部发送消息
     * @param fromUser
     * @param toUser
     * @param title
     * @param msgContent
     */
    void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent);

    /**
     * 系统内部发送消息
     * @param fromUser
     * @param toUser
     * @param title
     * @param msgContent
     * @param msgCategory
     */
    void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent,String msgCategory);

    /**
     * 使用模板发布消息
     * @param fromUser
     * @param toUser
     * @param title
     * @param map
     * @param templateCode
     */
    void sendSysAnnouncement(String fromUser, String toUser, String title, Map<String, String> map, String templateCode);

    /**
     * 使用模板发布消息
     * @param fromUser
     * @param toUser
     * @param title
     * @param map
     * @param templateCode
     * @param msgCategory
     */
    void sendSysAnnouncement(String fromUser, String toUser, String title, Map<String, String> map, String templateCode,String msgCategory);

    /**
     * 使用模板发布消息
     * @param fromUser
     * @param toUser
     * @param title
     * @param map
     * @param templateCode
     * @param msgCategory
     */
    void sendSysAnnouncement(String fromUser, String toUser, String title, Map<String, String> map, String templateCode,String msgCategory,Boolean callMe);
}
